<include file="header"/>
<body class="dorm-bg">
<div class="wraper" js="wapjs/base/quilt/js/index">
    <div class="tips">
        <p>您好，请输入您的真实信息</p>
        <p>以便快速知晓您的个人信息</p>
    </div>
    <div class="login">
        <div class="form-box">
            <div class="form-list">
                <input id="username" placeholder="请输入您的姓名"/>
            </div>

            <if condition="$golive eq 25">

                <div class="form-list">
                    <input id="card_id" type="" placeholder="请输入您的学号"/>
                </div>

                <else/>

                <div class="form-list">
                    <input id="card_id" type="" placeholder="请输入您的身份证号"/>
                </div>
            </if>
        </div>
        <a href="#" class="btn" id="query">开始查询</a>
        <input type="hidden" id="golive" value="{BEESCRM:$golive}">
    </div>
</div>

<div class="pop-box">
    <div class="tips-main text-center">
        <p>身份信息</p>
        <p>无法匹配，请核对后再输入</p>
        <a href="#" class="text-blue i_know">我知道了</a>
    </div>
</div>

</body>
<include file="footer"/>
<script>
    $('.pop-box').hide();
    $('.i_know').click(function () {
        $('.pop-box').hide();
    })
    $('#query').click(function () {
        var golive=$('#golive').val();
        var data = {};
        var username = $('#username').val();
        var card_id = $('#card_id').val();
        data.username = username;
        data.card_id = card_id;
        if (!data.username) {
            fm.alert('请填写真实姓名');
            return false;
        }
        var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
        if (!re.test(data.card_id)) {
            if(golive==25){
                fm.alert("请填写正确的学号");
            }else{
                fm.alert("请填写正确的身份证号");
            }

            return false;
        }
        $.ajax({
            url: "{BEESCRM::U('base/knowing/getUserInfo',array('golive'=>$golive))}",
            'type': 'post',
            data: data,
            dataType: "json",
            success: function (res) {
                if (res.status == 'F') {
                    $('.pop-box').show();
                } else {
                    window.location.href = res.url;
                }
            }
        })
    })

</script>
